﻿Imports BUS
Imports DTO
Public Class frmLapBaoCaoTongKetMon
    Private Sub LoadMonHoc()
        Dim mhBus As New MonHocBus()
        Dim ds As List(Of MonHocDto)
        ds = mhBus.LayDSMonHoc()
        cbbMon.DataSource = ds
        cbbMon.DisplayMember = "TenMon" 'ten chuoi giong trong property
        cbbMon.ValueMember = "MaMon"
    End Sub
    Private Sub LoadHocKy()
        Dim hkBus As New HocKyBus()
        Dim ds As List(Of HocKyDto)
        ds = hkBus.LayDSHocKy()
        cbbHocKy.DataSource = ds
        cbbHocKy.ValueMember = "MaHK"
        cbbHocKy.DisplayMember = "TenHocKy"
    End Sub
    
    Private Sub frmLapBaoCaoTongKetMon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            LoadMonHoc()
            LoadHocKy()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub

    Private Sub btnBaoCao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBaoCao.Click
        gridViewTongKetMon.Columns.Clear()
        gridViewTongKetMon.DataSource = LopHocBus.LayDanhSach(cbbMon.SelectedValue, cbbHocKy.SelectedValue)
    End Sub
End Class